﻿using System;
using System.Linq;
using System.Text;
using System.Linq.Expressions;


namespace YK.Component.Data
{
    using YK.Component.Tools;
    public interface IRepository<T>  where T : EntityBase
    {
        #region CRUD
        void Add(T entity);
        void Update(T entity);
        void Delete(T entity);
        void Delete(Expression<Func<T, bool>> where);
        #endregion

        #region query
        T GetById(long Id);
        T GetById(string Id);
        T Get(Expression<Func<T, bool>> where);
        IQueryable<T> GetAll();
        IQueryable<T> GetMany(Expression<Func<T, bool>> where);
        #endregion
    }
}
